<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!--edge浏览器H5兼容设置-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--360浏览器H5兼容设置-->
<meta name="renderer" content="webkit" />
<title>admin包下的login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--导入核心文件-->
<script src="/bootstrap3/js/holder.js"></script>
<link href="/bootstrap3/css/bootstrap.css" rel="stylesheet"
  type="text/css">
<script src="/bootstrap3/jquery-1.9.1.min.js"></script>
<script src="/bootstrap3/js/bootstrap.js"></script>
<!-- 字体图标 -->
<link rel="stylesheet"
  href="/bootstrap3/font-awesome-4.7.0/css/font-awesome.css" />
  <link rel="shortcut icon" href="http://www.sina.com.cn/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="/css/top.css" />
<link rel="stylesheet" type="text/css" href="/css/index.css" />
<link rel="stylesheet" type="text/css" href="/css/layout.css" />
<link rel="stylesheet" type="text/css" href="/css/login.css" />
<link rel="stylesheet" type="text/css" href="/css/footer.css" />
<script src="/bootstrap3/js/jquery.cookie.js" type="text/javascript"
  charset="utf-8"></script>
<link rel="shortcut icon" href="http://www.sina.com.cn/favicon.ico" type="image/x-icon">
<script src="/js/autoLogin.js" type="text/javascript"></script>
</head>
<body>
  <!--头部-->
  <header class="header">
    <h4>超级无敌幕后黑手登录专页</h4>
  </header>
  <!--主体-->
  <div class="container mycontent text-left">
    <!--透明层 -->
    <div class="loginDiv">
      <p>幕后黑手登录</p>
      <!--表单开始-->
      <form action="index.html" id="form-log" class="form-horizontal"
        role="form">
        <!--用户名-->
        <div class="form-group">
          <label for="username" class="col-md-3 control-label">名字：</label>
          <div class="col-md-8">
            <input type="text" name="username" class="form-control"
              id="username" placeholder="请输入用户名">
          </div>
        </div>
        <!--密码-->
        <div class="form-group">
          <label for="password" class="col-md-3 control-label">
            密码：</label>
          <div class="col-md-8">
            <input type="text" name="password" class="form-control"
              id="password" placeholder="请输入密码">
          </div>
        </div>
        <!--提交按钮-->
        <div class="form-group">
          <label class="col-md-3 control-label"></label>
          <div class="col-md-8">
            <input id="btn-log" class="btn btn-primary" type="button"
              value="登录" οnclick="that"/> 
          </div>
        </div>
      </form>
    </div>
  </div>
  <!--页脚结束-->
  <script type="text/javascript">
			$("#btn-log").click(function() {
				$.ajax({
					"url" : "/admin/doadminlogin",
					"data" : $("#form-log").serialize(),
					"type" : "POST",
					"dataType" : "json",
					"success" : function(json) {
						if (json.status == 200) {
							// 跳转路径
						    window.location.href = '/adminindex'
						    				
						} if(json.status == 400){
							alert("登录失败！"+"用户名错误"+ "！");
						}	if(json.status == 500){
							alert("登录失败！"+"密码错误"+ "！");
						}	
					}
				});
			});
		</script>
</body>
</html>